import { useUserStore } from '@jl/common/store';
import router from '.';

export const applyPermissionGuard = () => {
  router.beforeEach(async (to, from, next) => {
    const userStore = useUserStore();
    const sso = await userStore.sso(process.env.VUE_APP_ID!);
    if (sso) {
      next();
    }
  });
};
